0100 ;ECHO.M650110 ;Bill Aycock 3-870120 ;0130 ;Show the arguments on a0140 ; SpartaDOS command line0150 ;0160 ;For further info, see the0170 ; SpartaDOS owner's manual0180 ; (pgs 108-111)0190 ;0200 ;-----------------------------0210 ;0220 ;assemble the code out of the0230 ;way of everything0240 ;0250 *= $40000260 ;0270 ;0280 ;SpartaDOS will run a loaded0290 ;file at the beginning address0300 ;of the first segment, so0310 ;start the code with a JMP0320 ;to the control routine.0330 ;(start the routine with a0340 ; byte $60 (rts) if you don't0350 ; want the routine re-entered)0360 ;0370 JMP START0380 ;0390 ;0400 ;---equates-------------------0410 ;0420 ;0430 ZCR .WORD 0 ;get an arg0440 CFN .WORD 0 ;arg buffer0450 DOSVEC = $0A ;addr of comtab0460 CIOV = $E456 ;cio vector0470 COM = $0342 ;iccom0480 ADR = $0344 ;icbal0490 LEN = $0348 ;icbll0500 ;0510 ;0520 ;------------------------------0530 ;0540 FIXPTRS0550 ;0560 ;set up the pointers to the0570 ;SpartaDOS routine to get an0580 ;arg (ZCRNAME) and to the0590 ;arg buffer (COMFNAM)0600 ;0610 LDA DOSVEC+1 ;zcr=comtab+30620 STA ZCR+10630 LDA DOSVEC0640 CLC 0650 ADC #30660 BCC OK10670 INC ZCR+10680 OK10690 STA ZCR0700 LDA ZCR+1 ;cfn=comtab+330710 STA CFN+10720 LDA ZCR0730 CLC 0740 ADC #300750 BCC OK20760 INC CFN0770 OK20780 STA CFN0790 RTS 0800 ;0810 ;0820 ;-----------------------------0830 ;0840 CALLZ0850 ;0860 ;fake an indirect jsr to zcr0870 ;by 'jsr callz'0880 ;0890 JMP (ZCR)0900 ;0910 ;0920 ;-----------------------------0930 ;0940 SHOW0950 ;0960 ;show the arg in the buffer0970 ;(note that 'Dn:' is added0980 ;in front of each argument,0990 ;so skip 3 bytes if necessary)1000 ;1010 LDX #01020 STX LEN+11030 LDA CFN1040 STA ADR1050 LDA CFN+11060 STA ADR+11070 LDA #281080 STA LEN1090 LDA #9 ;print text line1100 STA COM1110 JSR CIOV1120 RTS 1130 ;1140 ;1150 ;-----------------------------1160 ;1170 START1180 ;1190 ;set it up and do it1200 ;1210 JSR FIXPTRS1220 GO1230 JSR CALLZ1240 BEQ QUIT ;z set=no args1250 JSR SHOW1260 TYA 1270 BPL GO1280 QUIT1290 RTS 1300 ;1310 .END 4444444444444444444444444444444444444444444444444444444444444444444444444444